#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Released under the 3-clause BSD license.

command="${ncd_exec:-"/usr/bin/badvpn-ncd"}"
command_args="${ncd_args} --config-file ${ncd_config:-/etc/ncd.conf}"
command_background="YES"
description="Network Configuration Daemon"
pidfile="/var/run/${RC_SVCNAME}.pid"

depend() {
	need localmount
	after bootmisc
	before netmount
}

start_pre() {
	if yesno "${ncd_syslog:-NO}"; then
		command_args="${command_args}
			--logger syslog
			--syslog-ident \"${ncd_syslog_ident:-${RC_SVCNAME}}\"
			--channel-loglevel ncd_log_msg info"
	fi
}
